%{
 
 #include <stdlib.h>
 #include "y.tab.h"

%}

%%

("class")            return CLASS;       
("function")         return FUNCTION;    
("constructor")      return CONSTRUCTOR; 
("array")            return ARRAY;       
("main")             return MAIN;        
("return")           return RETURN;      
("int")              return INT;         
("if")               return IF;          
("else")             return ELSE;        
("while")            return WHILE;       
("print")            return PRINT;       
("new")              return NEW;        
("#")                return END;
(".")                return POINT;
(",")                return COMMA;
("!")                return NO;
("+")                return ADD;
("-")                return SUB;
("*")                return MUL;
("==")               return EQUAL;
("=")                return ASSIGN;
("<")                return LESS;            
("{")                return LFIGUREBRACKET;
("}")                return RFIGUREBRACKET;
("(")                return LROUNDBRACKET;
(")")                return RROUNDBRACKET;
(";")                return SEMICOLON;
(":")                return COLON;
("$")                return DELIMETER;
("&&")               return AND;
("||")               return OR;
("<=")               return LESSOREQUAL;
("/")                return DIV;

[a-zA-Z][a-zA-Z0-9]* return ID;     
[0-9]+               return INTLITERAL;  
[ \t\n]*

.                    yyerror();

%%

int main(void)
{
   yyparse();
   return 0;
}

int yywrap(void)
{
   return 0;
}

int yyerror(void)
{
    printf("Error\n");
    exit(1);
}
